package com.example.a12138.myapplication.Activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.a12138.myapplication.R;
import com.example.a12138.myapplication.model.Book;
import com.example.a12138.myapplication.presenter.BookPresenter;
import com.xdw.mvp.pv.PresentView;

public class TestActivity extends AppCompatActivity {
    private TextView textView;

    private BookPresenter bookPresenter;

    private PresentView<Book> bookPresentView = new PresentView<Book>() {
        @Override
        public void onSuccess(Book book) {
                textView.setText(book.getName().toString());
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);
        textView=findViewById(R.id.tvName);

        bookPresenter=new BookPresenter(this);
        bookPresenter.onCreate();
        bookPresenter.BindPresentView(bookPresentView);

        bookPresenter.getBookById(13);
    }
}
